An embedded application is a computer system that is a component within a larger system. In embedded applications, it is often necessary to store data to non-volatile memory in order to maintain valid data despite removal of power. This is in contrast with volatile memory (typically random access memory (RAM)) that requires power at all times to maintain valid data. Typically, non-volatile memory is implemented with a special chip called an EEPROM (electrically eraseable, programmable read only memory). The storage of data to the EEPROM is typically controlled by a microprocessor, a microcontroller or digital signal processor (often referred to as a “controller”) located within the embedded system. During operation, when the controller needs to store data to the EEPROM, it performs a simple write operation. Likewise, if the controller needs to read data previously stored to the EEPROM, it performs a simple read operation. If data previously written to the EEPROM needs to be updated (i.e., new data is going to replace old data), then the write operation simply over-writes this old data with the new data. EEPROMs therefore allow easy updating and writing of data. However, EEPROMs are limited in the total amount of data that can be stored. For applications that require greater storage capacity in a small amount of space, a type of non-volatile memory known as flash memory is a better choice.
Flash memory, although providing greater storage density than EEPROM devices, presents some obstacles not found in EEPROM devices. The biggest difference between flash memory and EEPROM memory is that flash memory locations cannot be overwritten. When a flash memory module is initialized, every location is initialized to a logic level of “1”. When data is written to a logical address, selected bits within the flash module are converted from a logic level of “1” to a logic level of “0”. However, data bits cannot be individually written from a logic level of “0” back to a logic level of “1”. Therefore, writing to a location for a first time within the flash memory is easily done, with a simple write operation similar to the EEPROM write operation. Writing new data to a previously written location within the flash memory is not easily done, and in fact requires that the location be erased (i.e., set to a logic level of “1”) before the location can be written again.
Another obstacle presented by flash memory is the inability to erase or initialize individual locations within the flash memory. Erasing a particular location within the flash memory requires that most of the adjacent locations also be erased. If a particular location within the flash memory is to be updated with new data, data stored in the adjacent locations must be stored temporarily while the particular location (and adjacent locations) are erased, then updated data corresponding to the particular location as well as data stored in the adjacent locations must be rewritten.
In many applications, these obstacles do not present a problem or the problem may be avoided. For instance, flash memory is often used to store pictures on digital cameras or music on portable music players. These applications make use of a circular buffer, in which data is written at progressive memory locations. When the end of the buffer is reached, the buffer wraps around to the beginning, erasing the old data and storing new data. This type of system, however, only allows data to be written in a sequential manner, which works well for applications like music or digital photos in which the data is naturally sequential. For example, a digital image is stored as a series of sequential data words.
Other applications make use of a flash management system to allow the overwriting of old data. These systems typically run on top of a standard operating system, which means they use the filing system provided by the standard operating system, (e.g., the FAT16 filing system used by DOS). These filing systems are only capable of storing entire files (which vary in length from a few bytes to a thousands of bytes), and therefore require considerable overhead in processing power in order to utilize flash memory devices for data storage. Each time a change, however small, is made to a particular file, the filing system must rewrite the entire file to a new section of flash memory. While these systems manage the obstacles discussed above with regard to flash memory, they are unable to operate in real-time, as the host operating system and file storage system will introduce delays into the write and read access times. In particular, delays are introduced because the filing system used by these operating systems only allows individual files to be stored, rather than individual bytes. File-oriented systems, as opposed to byte-oriented systems, are not well suited for embedded applications which store small amounts of data to memory at a time. Therefore, a system that would allow embedded systems (which require the ability to overwrite old data and operate in real time) to utilize high storage capacity flash memory is desirable.